package li.webqq.api;

import li.http.Request;
import li.webqq.Const;
import li.webqq.util.StringUtil;

/**
 * http://www.qqxieyi.com/fenxi_show.asp?id=25
 */
public class Poll2Request extends Request implements Const {
    private String psessionid;

    public void setPsessionid(String psessionid) {
        this.psessionid = psessionid;
    }

    public Poll2Response execute() {
        String r = StringUtil.build(R_POLL2, psessionid);

        super.setUrl(URL_POLL2);
        super.setReferer(URL_PROXY);
        super.setContentType(FORM_URLENCODED);

        super.setField("r", StringUtil.encode(r));
        super.setField("clientid", CLIENT_ID);
        super.setField("psessionid", psessionid);

        return super.execute(new Poll2Response());
    }
}